from sanic.views import HTTPMethodView
from sanic.response import json

from apps.model import BlogPost


class SimapleAsyncView(HTTPMethodView):
    async def get(self, request):
        data = [post.title for post in BlogPost.objects]
        return json({"msg": "view", 'data': data})
